/*
 * ipvn_service.hpp
 *
 *  Created on: Oct 19, 2012
 *      Author: khanhhh
 */

#ifndef IPVN_SERVICE_HPP_
#define IPVN_SERVICE_HPP_
#include "../lua_interaction/luna.hpp"
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>

#include <protocol/TBinaryProtocol.h>
#include <transport/TSocket.h>
#include <transport/TTransportUtils.h>
#include "IpvnService.h"
#include <boost/shared_ptr.hpp>
#include <iostream>

namespace http {
namespace server3 {
class ipvn_service {
public:
	static const char className[];
	static Luna<ipvn_service>::RegType methods[];

	ipvn_service(lua_State *L);
	int is_ipvn(lua_State *L);
	~ipvn_service();
private:
    std::string ip;
    int port;

    boost::shared_ptr<apache::thrift::transport::TTransport> socket_ptr_;
    boost::shared_ptr<apache::thrift::transport::TTransport> transport_ptr_;
    boost::shared_ptr<apache::thrift::protocol::TProtocol> protocol_ptr_;
    boost::shared_ptr<IpvnServiceClient> client_ptr_;
};
}
}
#endif /* IPVN_SERVICE_HPP_ */
